package com.youoor.dto;

import java.util.HashMap;
import java.util.Map;

/**
 * 接口调用返回参数包装对象
 * 
 * @author guoxiaoliang
 */
public class RetDTO {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -9147443786735278708L;


	private static final String CODE_OK = "CODE_OK";

	
	private String code;
	
	private Map<String,Object> result = new HashMap<String,Object>();
	
//	public AppResultDTO() {
//		this.code = CODE_OK;
//	}
	
	public boolean isSuccess() {
		return this.code.equals(CODE_OK);
	}

	public void markSuccess() {
		this.code = CODE_OK;
	}

	public void addResult(String key,Object value) {
		result.put(key, value);
	}
	
	public void addMap(String key ,Object value){
		result.put(key, value);
	}
	
	public Map<String, Object> getResult() {
		return result;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	
}